#!/usr/bin/env bash

yum -y update
echo "3秒后开始安装哦！"
echo "更新yum成功"
sleep 3
yum -y install https://as-repository.openvpn.net/as-repo-centos7.rpm
sleep 3
yum -y install openvpn-as
echo ""
echo "VPN安装成功！"
sleep 6
cat /usr/local/openvpn_as/init.log
echo ""
echo ""
echo "账号密码在上面，注意看哦！"
echo ""
echo ""
sleep 3
firewall-cmd --zone=public --add-port=943/tcp --permanent
echo "防火墙放行成功！"
sleep 3
systemctl restart firewalld
echo "防火墙重启成功！"
echo ""
echo "需要重启防火墙哦，放行安全组端口943，如果程序执行失败，每一行执行一遍哦！"
echo "超管 链接地址是https://{ip}:943/admin"
echo "账号密码在上面，注意看哦！"